{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "注释很重要，语句结束2个空格之后，加注释\n"
     ]
    }
   ],
   "source": [
    "print('注释很重要，语句结束2个空格之后，加注释')  # 空一格空格"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "23 <class 'int'>\n"
     ]
    }
   ],
   "source": [
    "# int类型\n",
    "num = 23\n",
    "print(num, type(num))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "23.9 <class 'float'>\n",
      "-1.06 <class 'float'>\n"
     ]
    }
   ],
   "source": [
    "# float类型\n",
    "price = 23.9\n",
    "print(price, type(price))\n",
    "\n",
    "change = -1.06\n",
    "print(change, type(change))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "btc/usdt <class 'str'>\n"
     ]
    }
   ],
   "source": [
    "# str类型\n",
    "symbol = 'btc/usdt'\n",
    "print(symbol, type(symbol))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "True False <class 'bool'>\n",
      "False\n",
      "False\n",
      "3 & 1 的结果:  1\n",
      "2 >= 3 & 1 的结果:  True\n",
      "0 & 1 的结果:  False\n",
      "-------\n",
      "1\n",
      "1\n"
     ]
    }
   ],
   "source": [
    "# bool类型\n",
    "print(True, False, type(True))\n",
    "print(2 >= 3)\n",
    "print(2 >= 3 and 1 == 1)\n",
    "print('3 & 1 的结果: ',3 & 1)\n",
    "print('2 >= 3 & 1 的结果: ', 2 >= 3 & 1) # 这个可能是先算了 3&1  再算 2 > 1\n",
    "print('0 & 1 的结果: ', (2 >= 3) & (1 == 1))\n",
    "\n",
    "print('-------')\n",
    "\n",
    "print(0 or 1)\n",
    "print(0 | 1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "None <class 'NoneType'>\n"
     ]
    }
   ],
   "source": [
    "# None类型\n",
    "print(None, type(None))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "9\n",
      "8\n"
     ]
    }
   ],
   "source": [
    "# 取余操作\n",
    "print(9 % 15)\n",
    "\n",
    "# 2的3次方\n",
    "print(2 ** 3)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
